package com.lng.usercenter

import android.content.Intent
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.support.v4.content.LocalBroadcastManager
import kotlinx.android.synthetic.main.activity_main1.*

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main1)

        helloTV.setOnClickListener {

            var localBroadcastManager = LocalBroadcastManager.getInstance(this)

            var intent = Intent("LOCAL_ACTION")
            intent.putExtra("aa", 10)
            localBroadcastManager.sendBroadcast(intent)
        }
    }
}
